#ifndef HPLCCOMMONPAGE_H
#define HPLCCOMMONPAGE_H

#include <QWidget>
#include <QLabel>
#include <QLineEdit>
#include <QPushButton>
#include <QHBoxLayout>
#include <QVBoxLayout>

class HplcCommonPage : public QWidget
{
    Q_OBJECT
public:
    HplcCommonPage(QWidget *parent = nullptr);
    ~HplcCommonPage() override;

protected:
    virtual void closeEvent(QCloseEvent *event) override;

public slots:
    void onParseCompleted(int id, const QVariant &var);

private:
    // 设备地址
    QLabel *m_lbDeviceAddress;
    QLineEdit *m_leDeviceAddress;
    QPushButton	*m_pbSetDeviceAddress;
    QPushButton	*m_pbGetDeviceAddress;
    QHBoxLayout *hblDeviceAddress;

    // 软件版本
    QLabel *m_lbSoftwareVersion;
    QLineEdit *m_leSoftwareVersion;
    QPushButton	*m_pbSetSoftwareVersion;
    QPushButton	*m_pbGetSoftwareVersion;
    QHBoxLayout *hblSoftwareVersion;

    // 硬件版本
    QLabel *m_lbHardwareVersion;
    QLineEdit *m_leHardwareVersion;
    QPushButton	*m_pbSetHardwareVersion;
    QPushButton	*m_pbGetHardwareVersion;
    QHBoxLayout *hblHardwareVersion;

    // 生产日期
    QLabel *m_lbProductDate;
    QLineEdit *m_leProductDate;
    QPushButton	*m_pbSetProductDate;
    QPushButton	*m_pbGetProductDate;
    QHBoxLayout *hblProductDate;

    // 序列号
    QLabel *m_lbSerialNumber;
    QLineEdit *m_leSerialNumber;
    QPushButton	*m_pbSetSerialNumber;
    QPushButton	*m_pbGetSerialNumber;
    QHBoxLayout *hblSerialNumber;

    // 型号
    QLabel *m_lbModel;
    QLineEdit *m_leModel;
    QPushButton	*m_pbSetModel;
    QPushButton	*m_pbGetModel;
    QHBoxLayout *hblModel;

    // 使用时间
    QLabel *m_lbUsedTime;
    QLineEdit *m_leUsedTime;
    QPushButton	*m_pbSetUsedTime;
    QPushButton	*m_pbGetUsedTime;
    QHBoxLayout *hblUsedTime;

    // 同步时间
    QLabel *m_lbSyncTime;
    QLineEdit *m_leSyncTime;
    QPushButton	*m_pbSetSyncTime;
    QPushButton	*m_pbGetSyncTime;
    QHBoxLayout *hblSyncTime;

    // 输入点
    QLabel *m_lbInput;
    QLineEdit *m_leInputPos;
    QLineEdit *m_leInputValue;
    QPushButton	*m_pbSetInput;
    QPushButton	*m_pbGetInput;
    QHBoxLayout *hblInput;

    // 输出点
    QLabel *m_lbOutput;
    QLineEdit *m_leOutputPos;
    QLineEdit *m_leOutputValue;
    QPushButton	*m_pbSetOutput;
    QPushButton	*m_pbGetOutput;
    QHBoxLayout *hblOutput;

    // 心跳包
    QLabel *m_lbTick;
    QLineEdit *m_leTick;
    QPushButton	*m_pbSetTick;
    QPushButton	*m_pbGetTick;
    QHBoxLayout *hblTick;

    // 心跳包周期
    QLabel *m_lbTickPeriod;
    QLineEdit *m_leTickPeriod;
    QPushButton	*m_pbSetTickPeriod;
    QPushButton	*m_pbGetTickPeriod;
    QHBoxLayout *hblTickPeriod;

    // 系统错误
    QLabel *m_lbError;
    QLineEdit *m_leError;
    QPushButton	*m_pbSetError;
    QPushButton	*m_pbGetError;
    QHBoxLayout *hblError;

    // 系统错误上传频率
    QLabel *m_lbErrorUploadFreq;
    QLineEdit *m_leErrorUploadFreq;
    QPushButton	*m_pbSetErrorUploadFreq;
    QPushButton	*m_pbGetErrorUploadFreq;
    QHBoxLayout *hblErrorUploadFreq;
};

#endif // HPLCCOMMONPAGE_H
